package com.ycl.bookstore.service.impl;

import com.ycl.bookstore.pojo.MyMessage;
import jakarta.annotation.Resource;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;

import static com.ycl.bookstore.utils.RabbitMqConstants.*;

@Service
public class MessageService {

    @Resource
    private RabbitTemplate rabbitTemplate;

    public void sendMessageWithIsLike(MyMessage message){
        rabbitTemplate.convertAndSend(FRIENDS_LIKE_EXCHANGE,FRIENDS_LIKE_ROUTINGKEY,message);
    }
}
